package cn.ssq.dao;


import cn.ssq.domain.SampleInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SampleInfoMapper {

    List<SampleInfo> selectLikeSampleId1();

    int deleteByPrimaryKey(Integer id);


    int updateByPrimaryKey(@Param("id") Integer id, @Param("sampleId") String sampleId, @Param("province") String province, @Param("city") String city, @Param("county") String county,
                           @Param("cropCategoryId") Integer cropCategoryId, @Param("breed") Integer breed, @Param("township") String township, @Param("village") String village,
                           @Param("household") String household, @Param("harvestTime") String harvestTime, @Param("samplingTime") String samplingTime,
                           @Param("samplingPeople") String samplingPeople, @Param("seasonal") String seasonal, @Param("description") String description, @Param("pollutionRate") String pollutionRate, @Param("isdel") String isdel);

    int insertSampleInfo(@Param("sampleId") String sampleId, @Param("province") String province, @Param("city") String city, @Param("county") String county,
                         @Param("cropCategoryId") Integer cropCategoryId, @Param("breed") Integer breed, @Param("township") String township, @Param("village") String village,
                         @Param("household") String household, @Param("harvestTime") String harvestTime, @Param("samplingTime") String samplingTime,
                         @Param("samplingPeople") String samplingPeople, @Param("seasonal") String seasonal, @Param("description") String description, @Param("pollutionRate") String pollutionRate, @Param("isdel") String isdel);

        List<SampleInfo> findSampleInfoList(Integer isdel);

    /**
     * 分页操作，调用findByPage limit分页方法
     *
     * @param
     * @return
     */
    List<SampleInfo> selectLikeSampleId(@Param("sampleId") String sampleId, @Param("leftStr") String leftStr, @Param("rightStr") String rightStr, @Param("toxinType") String toxinType, @Param("cropSpecies") String cropSpecies, @Param("addressProvince") String addressProvince, @Param("addressCity") String addressCity, @Param("addressTown") String addressTown, @Param("date") String date, @Param("isdel") Integer isdel);


    int selectById(String sampleId);
    List<SampleInfo> updateSample(@Param("sampleId") String sampleId, @Param("leftStr") String leftStr, @Param("rightStr") String rightStr, @Param("toxinType") String toxinType, @Param("cropSpecies") String cropSpecies, @Param("addressProvince") String addressProvince, @Param("addressCity") String addressCity, @Param("addressTown") String addressTown, @Param("date") String date);

    SampleInfo selectBysampId(@Param("id") Integer id);
    int deleteSampleById(@Param("id") Integer id, @Param("isdel") Integer isdel);


    String[] selectverifyUser();


  /*  int insertInfo(@Param("sampleId") String sampleId,@Param("isdel") Integer isdel,@Param("cropCategoryId") Integer cropCategoryId ,@Param("breed") Integer cropCpeciesId,
                   @Param("sheng") String sheng,@Param("shi") String shi,
                   @Param("xian") String xian,@Param("xiang") String xiang,
                   @Param("cun") String cun,@Param("hu") String hu,
                   @Param("hTime") String hTime,@Param("sTime") String sTime,
                   @Param("samPeople") String samPeople,@Param("seasonal") String seasonal,
                   @Param("description") String description,@Param("pollutionRate") String pollutionRate);*/
int insertInfo(SampleInfo sampleInfo);


String selectIdBySampleId(Integer sid);

}